<template>
	<view class="ProductWHL" :class="type==1?'white':''">
		<view style="position: absolute;top: 0rpx;left: 0rpx; font-size: 30rpx;  font-weight: bold;"><span
				style="color:darkorange ;margin-right: 5px;">|</span> {{$t(size_name)}}</view>

		<view class="text" style="text-align: center;background-color: darkorange; 
		padding:5px 20px; margin-left: 30rpx; margin-top: 60rpx; border-radius: 10rpx;
		 color: #fff;" v-if="lang==='zh'">
			1{{item[$t("item.number_unit")]||''}}

			<view v-if="lang==='zh'">{{$t("最大尺寸")}}</view>
			<view v-if="lang !='zh'" style="font-size: 20rpx;">{{$t("最大尺寸")}}</view>
		</view>
		<view class="text" style="text-align: center;background-color: darkorange;
		padding:5px 20px; margin-left: 30rpx; margin-top: 60rpx; border-radius: 10rpx;
		 color: #fff;" v-if="lang==='ru'">
			1{{item.number_unit_ru||''}}

			<view v-if="lang==='zh'">{{$t("最大尺寸")}}</view>
			<view v-if="lang !='zh'" style="font-size: 20rpx;">{{$t("最大尺寸")}}</view>
		</view>
		<view class="imgBox" style="margin-right: 70rpx;">
			<view class="l absolute" v-if="item.goods_l>0">
				{{item.goods_l || 0}}m
			</view>
			<view class="w absolute" v-if="item.goods_w>0">
				{{item.goods_w || 0}}m
			</view>
			<view class="h absolute" v-if="item.goods_h>0">
				{{item.goods_h || 0}}m
			</view>
			<u-image width="200rpx" height="200rpx" :src="HTTP_IMG_UTL+'productItem.png'"></u-image>
		</view>
	</view>
</template>

<script>
	import {
		IMAGE_URL,
		HTTP_IMG_UTL
	} from "@/config/app";
	export default {
		name: "ProductWHL",
		props: {
			item: {
				type: Object,
				default: {},
			},
			type: {
				type: String | Number,
				default: 1,
			},
		},
		data() {
			return {
				HTTP_IMG_UTL,
				size_name: '尺寸信息',
				lang: getApp().globalData.lang,
			};
		},
		mounted() {
			console.log(this.lang);
			console.log(this.item);

		}
	}
</script>

<style lang="scss" scoped>
	.white {
		background-color: white;
	}

	.yellow {
		background-color: #fefcf6;
	}

	.ProductWHL {
		position: relative;
		width: 100%;
		margin: 0 auto;
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding-bottom: 20rpx;
		padding-top: 20rpx;

		.text {
			font-size: 28rpx;
			// font-weight: 600;
		}

		.imgBox {
			position: relative;

			.absolute {
				position: absolute;
			}

			.h {
				right: 105%;
				top: 50%;
			}

			.w {
				bottom: -25rpx;
				left: 0rpx;
			}

			.l {
				left: 80%;
				bottom: 0;
			}
		}
	}
</style>